function elm(id)
{
	return document.getElementById(id);
}

function switchDisplay(id, state)
{
	var obj = elm(id);
	if (state == null)
	{
		if (obj.style.display == 'none') obj.style.display = ''; else obj.style.display = 'none';
	}
	else if (state == 1) obj.style.display = '';
	else obj.style.display = 'none';
	return true;
}

function switchVis(id)
{
	var obj = elm(id);
	if (obj.style.visibility == 'hidden') obj.style.visibility = 'visible'; else obj.style.visibility = 'hidden';
	return true;
}

function getEvent(e)
{
	return window.event || e;
}

function whichKeyDown(e)
{
	var e = getEvent(e);
	return e.which || e.keyCode;
}

function preventAction(e)
{
	var e = getEvent(e);
	if (e.preventDefault) e.preventDefault();
	e.returnValue = false;
	return false;
}